<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('安全管理列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>数据名称：</label>
                                <input type="text" name="dataName"/>
                            </li>
                            <li>
                                <label>权限设置：</label>
                                <select name="qxsz" th:with="type=${@dict.getType('biz_data_set')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>加密存储：</label>
                                <select name="jmcc" th:with="type=${@dict.getType('sys_yes_no')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>传输加密：</label>
                                <select name="csjm" th:with="type=${@dict.getType('sys_yes_no')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>审计日志：</label>
                                <select name="sjrz" th:with="type=${@dict.getType('sys_yes_no')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>备份恢复：</label>
                                <select name="bfhf" th:with="type=${@dict.getType('sys_yes_no')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:aqgl:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:aqgl:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:aqgl:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:aqgl:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:aqgl:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:aqgl:remove')}]];
        var qxszDatas = [[${@dict.getType('biz_data_set')}]];
        var jmccDatas = [[${@dict.getType('sys_yes_no')}]];
        var csjmDatas = [[${@dict.getType('sys_yes_no')}]];
        var sjrzDatas = [[${@dict.getType('sys_yes_no')}]];
        var bfhfDatas = [[${@dict.getType('sys_yes_no')}]];
        var prefix = ctx + "system/aqgl";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "安全管理",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '',
                    visible: false
                },
                {
                    field: 'dataName',
                    title: '数据名称'
                },
                {
                    field: 'qxsz',
                    title: '权限设置',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(qxszDatas, value);
                    }
                },
                {
                    field: 'jmcc',
                    title: '加密存储',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(jmccDatas, value);
                    }
                },
                {
                    field: 'csjm',
                    title: '传输加密',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(csjmDatas, value);
                    }
                },
                {
                    field: 'sjrz',
                    title: '审计日志',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(sjrzDatas, value);
                    }
                },
                {
                    field: 'bfhf',
                    title: '备份恢复',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(bfhfDatas, value);
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>